package com.wws.family.db.dao

import androidx.room.Dao
import androidx.room.Query
import androidx.room.Update
import com.wws.family.db.MedicineBean

/**
 *@Description: 药品数据Dao
 *@Date: 2024/11/04 14:06
 *@Author: WangWeiShuo
 */
@Dao
interface MedicineDao: BaseDao<MedicineBean> {

    @Query("select * from db_medicine")
    fun getMedicineInfo(): MutableList<MedicineBean>

    @Query("select * from db_medicine where endDate <= :time")
    fun getMedicineInfoByTime(time: String?): MutableList<MedicineBean>

    @Update
    fun updateMedicine(bean: MedicineBean)

    @Query("delete from db_medicine")
    fun deleteAll()

    @Query("delete from db_medicine where name = :name")
    fun deleteByName(name: String)
}